export default {
  namespaced: true,
  state: {
    user: localStorage.getItem('user')
      ? JSON.parse(localStorage.getItem('user'))
      : {},
    token: localStorage.getItem('token') || '',
    role: localStorage.getItem('role') || ''
  },
  mutations: {
    INIT_USER(state, user) {
      state.user = user
    },
    USER_GOOUT() {
      localStorage.removeItem('role')
      localStorage.removeItem('user')
      localStorage.removeItem('token')
    }
  }
}
